package com.acsior.hibernate.vo;

// default package

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernateVO;

/**
 * CdTypePayment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cdTypePayments")
@GeneratorKey(tableName = "cdTypePayments")
public class CdTypePaymentVO extends HibernateVO {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 1688197327574827516L;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdTypePayment")
	private List<CdReceiptBodyVO> cdReceiptBodies;

	@Column(name = "name", nullable = false)
	private String name;

	@Id
	@Column(name = "typePaymentID", unique = true, nullable = false)
	private Integer typePaymentId;

	// Constructors

	/** default constructor */
	public CdTypePaymentVO() {
		this.cdReceiptBodies  = new ArrayList<CdReceiptBodyVO>();
	}

	
	/**
	 * @return стойността на cdReceiptBodies
	 */
	public List<CdReceiptBodyVO> getCdReceiptBodies() {
		return this.cdReceiptBodies;
	}

	
	/**
	 * @param cdReceiptBodies се залага в cdReceiptBodies
	 */
	public void setCdReceiptBodies(List<CdReceiptBodyVO> cdReceiptBodies) {
		this.cdReceiptBodies = cdReceiptBodies;
	}

	
	/**
	 * @return стойността на name
	 */
	public String getName() {
		return this.name;
	}

	
	/**
	 * @param name се залага в name
	 */
	public void setName(String name) {
		this.name = name;
	}

	
	/**
	 * @return стойността на typePaymentId
	 */
	public Integer getTypePaymentId() {
		return this.typePaymentId;
	}

	
	/**
	 * @param typePaymentId се залага в typePaymentId
	 */
	public void setTypePaymentId(Integer typePaymentId) {
		this.typePaymentId = typePaymentId;
	}


	/**
	 * @see com.acsior.dac.data.Data#getId()
	 */
	@Override
	public Object getId() {
		return getTypePaymentId();
	}


	/**
	 * @see com.acsior.dac.impl.hibernate.vo.HibernateVO#setId(java.lang.Object)
	 */
	@Override
	public void setId(Object id) {
		setTypePaymentId(Integer.class.cast(id));
	}
}